package com.demo.component;

import com.demo.model.User;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component
public class UserBeans {
        @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
        @Bean
        public User user1() {
            User user = new User();
            user.setId(1);
            user.setName("Java");
            user.setPassword("123456");
            return user;
        }
        @Bean
        public User user2() {
            User user = new User();
            user.setId(2);
            user.setName("Linux");
            user.setPassword("22334");
            return user;
        }
}
